package com.ruoyi.product.domain.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.product.domain.vo.Sku;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ProductDetailDto {
    private Long spuId;
    private String spuName;
    private String spuTitle;
    private String spuDescription;
    private List<Sku> skus;

    /**
     * 临时字段：从数据库获取的原始规格组名字符串
     */
    @JsonIgnore
    private String specNameGroupRaw;
    /**
     * 临时字段：从数据库获取的原始规格组值字符串
     */
    @JsonIgnore
    private String specValueGroupRaw;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdAt;
    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updatedAt;
    /**
     * 单个图片路径
     */
    @JsonIgnore
    @Excel(name = "单个图片路径")
    private String url;
    /**
     * 多个图片路径
     */
    private List<String> urls;
    /**
     * sku名
     */
    @Excel(name = "sku名")
    private String skuName;
    /**
     * 商品描述
     */
    @Excel(name = "商品描述")
    private String description;

    @JsonIgnore
    private Long couponId;
    @JsonIgnore
    private Long activityId;
    @JsonIgnore
    private Long skuId;
    // @JsonIgnore
    // private Long spuId; // 用于从数据库获取数据，映射到spuId
    @JsonIgnore
    private String code;
    @JsonIgnore

    private String categoryId;
    @JsonIgnore

    private String specData;
    @JsonIgnore

    private BigDecimal price;
    @JsonIgnore

    private BigDecimal originalPrice;
    @JsonIgnore

    private Long stock;
    @JsonIgnore

    private Long lowStock;
    @JsonIgnore

    private BigDecimal weight;
    @JsonIgnore

    private BigDecimal volume;
    @JsonIgnore

    private Long status;

    @JsonIgnore
    private List<String> specNameGroup;
    @JsonIgnore
    private List<String> specValueGroup;

    @JsonIgnore
    private String couponCode;
    @JsonIgnore
    private Long couponType;
    @JsonIgnore
    private Double couponValue;
    @JsonIgnore
    private Double couponMinAmount;
    @JsonIgnore
    private String couponStartTime;
    @JsonIgnore
    private String couponEndTime;

    @JsonIgnore
    private String activityName;
    @JsonIgnore
    private Long activityType;
    @JsonIgnore
    private Long activityStatus;
    @JsonIgnore
    private String activityDescription;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date activityEndTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date activityCreateTime;
}
